Class: ViewActionAdapter
- Inherits:
-
ActionAdapter
- Object
- ActionAdapter
- ViewActionAdapter
- Defined in:
- lib/ribit/action.rb
Direct Known Subclasses
Instance Method Summary collapse
- #get_url ⇒ Object
-
#initialize(targetID, text = nil) ⇒ ViewActionAdapter
constructor
A new instance of ViewActionAdapter.
- #process(element) ⇒ Object
- #to_ele ⇒ Object
Methods inherited from ActionAdapter
Constructor Details
#initialize(targetID, text = nil) ⇒ ViewActionAdapter
Returns a new instance of ViewActionAdapter.
933 934 935 936 937 |
# File 'lib/ribit/action.rb', line 933 def initialize( targetID, text=nil ) # id might be number @targetID = targetID.to_s @linkText = text end |
Instance Method Details
#get_url ⇒ Object
951 952 953 954 955 |
# File 'lib/ribit/action.rb', line 951 def get_url propertyList = PropertyList.new propertyList.put( Constants::PAGE_ID_REQUEST_PARAM_NAME, @targetID ) return build_url( ViewAction::ID, propertyList ) end |
#process(element) ⇒ Object
940 941 942 943 944 945 946 947 948 |
# File 'lib/ribit/action.rb', line 940 def process( element ) # build url element.attributes['href'] = get_url() # change link text only if specified so if ( @linkText != nil ) element.text = @linkText end end |
#to_ele ⇒ Object
958 959 960 961 962 963 |
# File 'lib/ribit/action.rb', line 958 def to_ele element = REXML::Element.new( 'a' ) element.attributes['href'] = get_url() element.text = @linkText return element end |