UR::Object::View::Default::Text3pm
Object views in text format
Usage
$o = Acme::Product->get(1234);# generates a UR::Object::View::Default::Text object:$v = $o->create_view(toolkit => 'text',aspects => ['id','name','qty_on_hand','outstanding_orders' => ['id','status','customer' => ['id','name',]],],);$txt1 = $v->content;$o->qty_on_hand(200);$txt2 = $v->content;
Overview
This class implements basic text views of objects. It is used for command-line tools, and is the base class for other specific text formats like XML, HTML, JSON, etc.
Writing a subclass
# In Acme/Product/View/OutstandingOrders/Text.pmpackage Acme::Product::View::OutstandingOrders::Text;use UR;class Acme::Product::View::OutstandingOrders::Text {is => 'UR::Object::View::Default::Text'};sub _initial_aspects {return ('id','name','qty_on_hand','outstanding_orders' => ['id','status','customer' => ['id','name',]],);}$v = $o->create_view(perspective => 'outstanding orders', toolkit => 'text');print $v->content;
Releases
6 releases since Debian 8 (Jessie); the text changed 4 times.